import React from 'react';
import { observer } from 'mobx-react';
import ReplyStore from '../../stores/reply';
import Content from './content';
import { Spin } from 'antd';
import { WeaLocaleProvider } from "ecCom";
const getLabel = WeaLocaleProvider.getLabel;

export interface ReplyProps {
    reply: ReplyStore;
    padding?:any;
}

@observer
export default class ReplyBase extends React.Component<ReplyProps, any> {

    render() {
        const { reply,padding={ left: 50, right: 50} } = this.props;
        return (
            <Spin spinning={reply.loading} tip={getLabel(31230,"加载中")+"..."}>
                <div className="cube-reply" style={{marginLeft:padding.left,marginRight:padding.right}}>
                    {
                        reply  && reply.showReply ? <Content {...this.props} />:
                        reply.showReply===false?
                        <div className="cube-no-open-reply">{getLabel("391240", "请联系管理员后台开启回复评论功能！")}</div>
                        :null
                    }
                </div>
            </Spin>
        )
    }
}